﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace splashScreen
{
    public partial class LogTarefa : Form
    {
        public LogTarefa()
        {
            InitializeComponent();
        }

        private void logsTarefaBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            try
            {
                if((idTextBox.Text!="") && (dataDateTimePicker.Text!= "") && (logTextBox.Text!="") && (tarefa_idTextBox.Text!= "")){
                this.Validate();
                this.logsTarefaBindingSource.EndEdit();
                MessageBox.Show("Cadastro realizado com sucesso");
                this.tableAdapterManager.UpdateAll(this.pDSDDataSet);
                }
                else
                {
                    MessageBox.Show("Todos os campos devem ser preenchidos");
                }
            }
            catch (Exception ex) {
                MessageBox.Show("Não foi possível cadastrar: " + ex.Message);
            }

        }

        private void LogTarefa_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'pDSDDataSet.LogsTarefa' table. You can move, or remove it, as needed.
            this.logsTarefaTableAdapter.Fill(this.pDSDDataSet.LogsTarefa);

        }
    }
}
